package com.linsir.gen.service.impl;

import com.linsir.core.service.impl.BaseServiceImpl;
import com.linsir.gen.entity.SysGenConfig;
import com.linsir.gen.entity.SysGenScheme;
import com.linsir.gen.entity.SysGenTable;
import com.linsir.gen.mapper.SysGenSchemeMapper;
import com.linsir.gen.service.SysGenSchemeService;
import com.linsir.gen.service.SysGenTableService;
import com.linsir.gen.util.GenUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：linsir
 * @date ：Created in 2022/10/8 11:06
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class SysGenSchemeServiceImpl extends BaseServiceImpl<SysGenSchemeMapper, SysGenScheme> implements SysGenSchemeService {

    @Autowired
    private SysGenTableService sysGenTableService;

    @Override
    public String generateCode(SysGenScheme sysGenScheme) {
        StringBuilder result = new StringBuilder();

        SysGenTable sysGenTable = sysGenTableService.getEntity(sysGenScheme.getSysGenTable().getId());

        SysGenConfig sysGenConfig = GenUtils.getSysGenConfig();

        List templateList = GenUtils.getTemplateList(sysGenConfig,sysGenScheme.getCategory(),false);


        List childTableTemplateList = GenUtils.getTemplateList(sysGenConfig, sysGenScheme.getCategory(), true);

        return null;
    }
}
